﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace LoveEat.MODEL.WeChat
{
    public class BaseWeChatMsgSent
    {
        /// <summary>
        /// 接收方帐号（收到的OpenID）
        /// </summary>	
        [DataMember(Name = "ToUserName")]
        [Display(Name = "接收方帐号（收到的OpenID）")]
        public string ToUserName { get; set; }

        /// <summary>
        /// 开发者微信号
        /// </summary>	
        [DataMember(Name = "FromUserName")]
        [Display(Name = "开发者微信号")]
        public string FromUserName { get; set; }

        /// <summary>
        /// 消息创建时间 （整型）。
        /// </summary>	
        [DataMember(Name = "CreateTime")]
        [Display(Name = "消息创建时间 （整型）")]
        public long CreateTime { get; set; }

        /// <summary>
        /// 消息类型
        /// </summary>	
        [DataMember(Name = "MsgType")]
        [Display(Name = "消息类型")]
        public string MsgType { get; set; }
    }

    public class WeChatMsgSentTxt : BaseWeChatMsgSent
    {
        /// <summary>
        /// 回复的消息内容
        /// </summary>	
        [DataMember(Name = "Content")]
        [Display(Name = "回复的消息内容")]
        public string Content { get; set; }
    }

    public class WeChatMsgSentPicVoice : BaseWeChatMsgSent
    {
        /// <summary>
        /// 通过素材管理接口上传多媒体文件，得到的id
        /// </summary>	
        [DataMember(Name = "MediaId")]
        [Display(Name = "通过素材管理接口上传多媒体文件，得到的id")]
        public string MediaId { get; set; }
    }

    public class WeChatMsgSentVideo : BaseWeChatMsgSent
    {
        /// <summary>
        /// 通过素材管理接口上传多媒体文件，得到的id
        /// </summary>	
        [DataMember(Name = "MediaId")]
        [Display(Name = "通过素材管理接口上传多媒体文件，得到的id")]
        public string MediaId { get; set; }

        /// <summary>
        /// 视频消息的标题
        /// </summary>	
        [DataMember(Name = "Title")]
        [Display(Name = "视频消息的标题")]
        public string Title { get; set; }

        /// <summary>
        /// 视频消息的描述
        /// </summary>	
        [DataMember(Name = "Description")]
        [Display(Name = "视频消息的描述")]
        public string Description { get; set; }
    }

    public class WeChatMsgSentMusic : BaseWeChatMsgSent
    {
        /// <summary>
        /// 视频消息的标题
        /// </summary>	
        [DataMember(Name = "Title")]
        [Display(Name = "音乐标题")]
        public string Title { get; set; }

        /// <summary>
        /// 视频消息的描述
        /// </summary>	
        [DataMember(Name = "Description")]
        [Display(Name = "音乐描述")]
        public string Description { get; set; }

        /// <summary>
        /// 音乐链接
        /// </summary>	
        [DataMember(Name = "MusicURL")]
        [Display(Name = "音乐链接")]
        public string MusicURL { get; set; }

        /// <summary>
        /// 高质量音乐链接，WIFI环境优先使用该链接播放音乐
        /// </summary>	
        [DataMember(Name = "HQMusicUrl")]
        [Display(Name = "高质量音乐链接")]
        public string HQMusicUrl { get; set; }

        /// <summary>
        /// 缩略图的媒体id，通过素材管理接口上传多媒体文件，得到的id
        /// </summary>	
        [DataMember(Name = "ThumbMediaId")]
        [Display(Name = "缩略图的媒体id")]
        public string ThumbMediaId { get; set; }
    }

    public class WeChatMsgSentTxtPic : BaseWeChatMsgSent
    {
        /// <summary>
        /// 图文消息个数，限制为10条以内
        /// </summary>	
        [DataMember(Name = "ArticleCount")]
        [Display(Name = "图文消息个数")]
        public int ArticleCount { get; set; }

        /// <summary>
        /// 图文列表
        /// </summary>	
        [DataMember(Name = "Description")]
        [Display(Name = "图文列表")]
        public List<Article> Articles { get; set; }


    }

    public class Article
    {
        /// <summary>
        /// 图文消息标题
        /// </summary>	
        [DataMember(Name = "Title")]
        [Display(Name = "图文消息标题")]
        public string Title { get; set; }

        /// <summary>
        /// 图文消息描述
        /// 消息 text
        /// 语音 voice
        /// 图片 image
        /// 视频 video
        /// 图文 news
        /// 地理位置 location
        /// </summary>	
        [DataMember(Name = "Description")]
        [Display(Name = "图文消息描述")]
        public string Description { get; set; }

        /// <summary>
        /// 图片链接，支持JPG、PNG格式，较好的效果为大图360*200，小图200*200
        /// </summary>	
        [DataMember(Name = "PicUrl")]
        [Display(Name = "图片链接")]
        public string PicUrl { get; set; }

        /// <summary>
        /// 点击图文消息跳转链接
        /// </summary>	
        [DataMember(Name = "Url")]
        [Display(Name = "点击图文消息跳转链接")]
        public string Url { get; set; }
    }
}
